var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
// 7. 抽象类
// 常规类
var Person = /** @class */ (function () {
    function Person(name, age) {
        this.name = name;
        this.age = age;
    }
    return Person;
}());
// 继承：
var Student = /** @class */ (function (_super) {
    __extends(Student, _super);
    function Student(name, age) {
        return _super.call(this, name, age) || this;
    }
    Student.prototype.speak = function () {
        console.log('你好！我是学生:', this.name);
    };
    return Student;
}(Person));
// 继承：
var Teacher = /** @class */ (function (_super) {
    __extends(Teacher, _super);
    function Teacher() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    // constructor(name:string, age:number){
    //     super(name,age)
    // }
    Teacher.prototype.speak = function () {
        console.log('你好！我是⽼师:', this.name);
    };
    return Teacher;
}(Person));
// Student实例
var s12 = new Student('张同学', 109);
var s22 = new Student('李同学', 110);
console.log(s12);
console.log(s22);
// Teacher实例
var t1 = new Teacher('刘⽼师', 104);
var t2 = new Teacher('孙⽼师', 105);
console.log(t1);
console.log(t2);
// 抽象类：不能去实例化，但可以被别⼈继承，抽象类⾥有抽象⽅法
